import { axios } from '@/utils/request'

const api = {
  couponPage: '/promotion/coupon/page',
  couponSave: '/promotion/coupon/save',
  couponUpdate: '/promotion/coupon/update',
  couponDelete: '/promotion/coupon/delete',
  apiCouponSend: '/promotion/coupon/sendCoupon'
}
export default api

export function couponPage (parameter) {
  return axios({
    url: api.couponPage,
    method: 'get',
    params: parameter
  })
}

export function couponSave (parameter) {
  return axios({
    url: api.couponSave,
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

export function couponUpdate (parameter) {
  return axios({
    url: api.couponUpdate,
    method: 'put',
    data: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}
export function couponDelete (parameter) {
  return axios({
    url: api.couponDelete,
    method: 'delete',
    data: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

export function apiCouponSend (parameter) {
  return axios({
    url: api.apiCouponSend,
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}
